export default class TransformExtension {


        public static Forward(transform:Laya.Transform3D){
            let forward:Laya.Vector3=new Laya.Vector3();
            transform.getForward(forward);
            return forward;
        }

        public static Right(transform:Laya.Transform3D):Laya.Vector3{
            let right:Laya.Vector3=new Laya.Vector3();
            transform.getRight(right);
            return right;
        }

        private static m_tspos=new Laya.Vector3();
        public static SetPosX(transform:Laya.Transform3D,posx:number)
        {   
            TransformExtension.m_tspos.x=posx;
            TransformExtension.m_tspos.y=transform.position.y;
            TransformExtension.m_tspos.z= transform.position.z;
            transform.position=TransformExtension.m_tspos;
        }

        public static SetPosY(transform:Laya.Transform3D,posy:number)
        {
            TransformExtension.m_tspos.x=transform.position.x;
            TransformExtension.m_tspos.y=posy;
            TransformExtension.m_tspos.z= transform.position.z;
            transform.position=TransformExtension.m_tspos;
        }


        public static SetPosXY(transform:Laya.Transform3D,posx:number,posy:number)
        {
            TransformExtension.m_tspos.x=posx;
            TransformExtension.m_tspos.y=posy;
            TransformExtension.m_tspos.z= transform.position.z;
            transform.position=TransformExtension.m_tspos;
        }


        public static SetPosXZ(transform:Laya.Transform3D,posx:number,posz:number)
        {
            TransformExtension.m_tspos.x=posx;
            TransformExtension.m_tspos.y=transform.position.y;
            TransformExtension.m_tspos.z= posz;
            transform.position=TransformExtension.m_tspos;
        }


        public static SetPosYZ(transform:Laya.Transform3D,posy:number,posz:number)
        {
            TransformExtension.m_tspos.x=transform.position.x;
            TransformExtension.m_tspos.y=posy;
            TransformExtension.m_tspos.z= posz;
            transform.position=TransformExtension.m_tspos;
        }


        public static SetPosZ(transform:Laya.Transform3D,posz:number)
        {
            TransformExtension.m_tspos.x=transform.position.x;
            TransformExtension.m_tspos.y=transform.position.y;
            TransformExtension.m_tspos.z= posz;
            transform.position=TransformExtension.m_tspos;
        }


        public static SetLocalPosX(transform:Laya.Transform3D,posx:number)
        {
            TransformExtension.m_tspos.x=posx;
            TransformExtension.m_tspos.y=transform.localPositionY;
            TransformExtension.m_tspos.z= transform.localPositionZ;
            transform.localPosition=TransformExtension.m_tspos;
        }


        public static SetLocalPosY(transform:Laya.Transform3D,posy:number)
        {
            TransformExtension.m_tspos.x=transform.localPositionX;
            TransformExtension.m_tspos.y=posy;
            TransformExtension.m_tspos.z= transform.localPositionZ;
            transform.localPosition=TransformExtension.m_tspos;
        }


       public static SetLocalPosZ(transform:Laya.Transform3D,posz:number)
        {
            TransformExtension.m_tspos.x=transform.localPositionX;
            TransformExtension.m_tspos.y=transform.localPositionY;
            TransformExtension.m_tspos.z= posz;
            transform.localPosition=TransformExtension.m_tspos;
        }


        public static SetLocalPosXY(transform:Laya.Transform3D,posx:number,posy:number)
        {
            TransformExtension.m_tspos.x=posx;
            TransformExtension.m_tspos.y=posy;
            TransformExtension.m_tspos.z= transform.localPositionZ;
            transform.localPosition= TransformExtension.m_tspos;
        }


        public static SetLocalPosXZ(transform:Laya.Transform3D,posx:number,posz:number)
        {
            TransformExtension.m_tspos.x=posx;
            TransformExtension.m_tspos.y=transform.localPositionY;
            TransformExtension.m_tspos.z= posz;
            transform.localPosition=TransformExtension.m_tspos;
        }
}